/***************************************************************************
  A SymbolBrowser plugin for JuffEd editor.

  Copyright: 2010 Aleksander Sokoloff <asokol@mail.ru>

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License.
  version 2 as published by the Free Software Foundation.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have rceived a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
***************************************************************************/


#ifndef ITEMS_H
#define ITEMS_H

#include <QStandardItem>
#include <QString>
#include "symbol.h"

class Item : public SymbolInfo, public QStandardItem
{
public:
    enum SortOrder {
        SortByLine,
        SortByName
    };

    explicit Item(const QString & text);
    explicit Item(const Symbol *symbol);

    bool detailed() const { return mDetailed; }
    void setDetailed(bool detailed);

    QString path() const { return mPath; }
    void setPath(const QString &path);

    SymbolInfo *relatedSymbol() const { return mRelatedSymbol; }

    bool operator< (const QStandardItem & other) const;

private:
    QString mPath;
    bool mDetailed;
    SymbolInfo *mRelatedSymbol;

    void updateText();
};



class ItemClass : public Item
{
public:
    ItemClass(const Symbol *symbol);
};



class ItemStruct : public Item
{
public:
    ItemStruct(const Symbol *symbol);
};



class ItemNamespace : public Item
{
public:
    ItemNamespace(const Symbol *symbol);
};


class ItemFunc : public Item
{
public:
    ItemFunc(const Symbol *symbol);
};


class ItemPrototype : public Item
{
public:
    ItemPrototype(const Symbol *symbol);
};



#endif // ITEMS_H
